Skip to content

Precommit: Format source_hsolver (Part II) - #8200

Open
Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:precommit-3-2
Open

Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:precommit-3-2

Conversation

@Growl1234

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Fix #

Unit Tests and/or Case Tests for my changes

  • Commands run:
  • Result summary:
  • Checks not run, with reason:

What's changed?

  • Example: brief summary of the user-visible or developer-facing change.

Governance Notes

  • INPUT/docs changes:
  • Core module impact:
  • Exceptions requested:

@Growl1234 Growl1234 added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Oct 22, 2026

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Please replace the template placeholders with a brief summary of the formatting/include-order changes and the exact checks and results, including any checks not run. A short note that INPUT and user documentation are unaffected is sufficient here.

@Growl1234 Growl1234 changed the title Precommit: Prettify source_hsolver (Part II) Precommit: Format source_hsolver (Part II) Oct 22, 2026
void pdtran_(int* m , int* n ,
double* alpha , double* a , int* ia , int* ja , int* desca ,
double* beta , double* c , int* ic , int* jc , int* descc );
void pddot_(int* n,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many lines.

int* jy,
int* descy,
int* incy);
void pdtran_(int* m,

@ZhouXY-PKU ZhouXY-PKU Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many lines.

template <typename T>
class DavidsonOwnershipTest : public ::testing::Test {};
class DavidsonOwnershipTest : public ::testing::Test
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can I say?

void pztrmm_(char* side , char* uplo , char* transa , char* diag , int* m , int* n ,
double _Complex* alpha , double _Complex* a , int* ia , int* ja , int* desca ,
double _Complex* b , int* ib , int* jb , int* descb );
void pzdotc_(int* n,

@ZhouXY-PKU ZhouXY-PKU Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many lines.

ParaPrepare(int KPAR_in, int nkstot_in)
: KPAR_(KPAR_in), nkstot_(nkstot_in) {}
ParaPrepare(int KPAR_in, int nkstot_in) : KPAR_(KPAR_in), nkstot_(nkstot_in)
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can I say?

@ZhouXY-PKU ZhouXY-PKU removed the The Absolute Zero Reduce the "entropy" of the code to 0 label Oct 23, 2026
@Growl1234

Copy link
Copy Markdown
Collaborator Author

The goal of this series of pre-commit PRs was to establish a consistent formatting standard across the entire repository and eventually make it a required check. This is especially relevant for C++, as we've already had a .clang-format file in the repository for several years. These PRs do not change any of the existing formatting rules in .clang-format. They simply bring the code that hasn't been following those rules into compliance.

That said, your point about the number of lines does make sense. However, this would also mean that we first need to discuss and revise the existing .clang-format rules, which have already been reviewed and refined over time. I am not sure how to move this forward in a better way that makes everyone happy.

I think, we should leave these decisions to @mohanchen.

@Growl1234
Growl1234 force-pushed the precommit-3-2 branch 3 times, most recently from eb945bc to 19c7665 Compare October 30, 2026 09:56
@Growl1234

Copy link
Copy Markdown
Collaborator Author

With the discussed alternative clang-format settings, this PR now adds a net 5000+ lines! @mohanchen, is this really what you want?

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of 19c7665d against 64463eb3 found no confirmed source correctness defect. No candidate formatter, build or runtime tests were run.

Comment thread .clang-format
Comment on lines 11 to +18
BinPackArguments: false
BinPackParameters: false

BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true

Cpp11BracedListStyle: true
FixNamespaceComments: true

# InsertBraces: true # only for clang-format version15.0.0 or later

# About include
IncludeBlocks: Regroup
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''

PackArguments:
BinPack: UseBreakAfter
BreakAfter: 3
PackParameters:
BinPack: UseBreakAfter
BreakAfter: 3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: In the pinned clang-format 23.1.3, PackArguments and PackParameters override the two legacy BinPack* settings above. Please remove those ineffective aliases so the active three-item packing threshold is clear.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants